Skip to content

Allow BraidingTensor to have a custom storage type#393

Open
kshyatt wants to merge 5 commits intomainfrom
ksh/cubt
Open

Allow BraidingTensor to have a custom storage type#393
kshyatt wants to merge 5 commits intomainfrom
ksh/cubt

Conversation

@kshyatt
Copy link
Copy Markdown
Member

@kshyatt kshyatt commented Apr 3, 2026

This is probably the nicest way to unblock the various MPSKit changes. I found the similarmatrixtype approach the least gross looking way to achieve this, but open to other ideas.

@kshyatt kshyatt requested review from Jutho and borisdevos April 3, 2026 09:27
@kshyatt
Copy link
Copy Markdown
Member Author

kshyatt commented Apr 6, 2026

The only thing missing here is the parser preprocessing for @planar, where we need to extract the storagetype to hand it over to the BraidingTensor constructor.

@Jutho
Copy link
Copy Markdown
Member

Jutho commented Apr 7, 2026

I will try to review asap, but I first have to catch up on the latest status of the treetransform stuff, as I never managed to review that part of the vectorize fusiontrees PR.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 14, 2026

Codecov Report

❌ Patch coverage is 89.41176% with 9 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/tensors/braidingtensor.jl 84.61% 8 Missing ⚠️
src/planar/preprocessors.jl 95.45% 1 Missing ⚠️
Files with missing lines Coverage Δ
ext/TensorKitAdaptExt.jl 61.53% <100.00%> (+11.53%) ⬆️
ext/TensorKitCUDAExt/TensorKitCUDAExt.jl 100.00% <100.00%> (ø)
ext/TensorKitCUDAExt/cutensormap.jl 74.66% <100.00%> (+0.69%) ⬆️
src/planar/preprocessors.jl 87.50% <95.45%> (+0.41%) ⬆️
src/tensors/braidingtensor.jl 69.67% <84.61%> (+0.19%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread src/tensors/braidingtensor.jl Outdated
Comment thread src/tensors/braidingtensor.jl
@kshyatt
Copy link
Copy Markdown
Member Author

kshyatt commented Apr 15, 2026

Anything more need doing here or is this ready to go after #389?

@kshyatt kshyatt marked this pull request as ready for review April 15, 2026 13:09
Comment thread src/tensors/braidingtensor.jl Outdated
Comment thread src/tensors/braidingtensor.jl Outdated
Comment thread src/tensors/braidingtensor.jl Outdated
Comment thread test/cuda/planar.jl Outdated
Comment thread Project.toml Outdated
Comment thread ext/TensorKitCUDAExt/cutensormap.jl
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 16, 2026

Your PR no longer requires formatting changes. Thank you for your contribution!

@kshyatt kshyatt force-pushed the ksh/cubt branch 2 times, most recently from f787d47 to e7361df Compare April 17, 2026 10:02
Copy link
Copy Markdown
Member

@lkdvos lkdvos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the main thing missing is still the @planar changes... I will try to find some time, but I seem to be having a million things 🙃

Comment thread ext/TensorKitCUDAExt/cutensormap.jl
Comment thread ext/TensorKitCUDAExt/TensorKitCUDAExt.jl Outdated
Comment thread src/tensors/braidingtensor.jl Outdated
Comment thread src/tensors/braidingtensor.jl Outdated
Comment thread src/tensors/braidingtensor.jl Outdated
Comment thread src/tensors/braidingtensor.jl Outdated
Comment thread src/tensors/braidingtensor.jl Outdated
@kshyatt
Copy link
Copy Markdown
Member Author

kshyatt commented Apr 17, 2026

I'll work on the preprocessor, don't worry about it! But my solution might be a bit ugly...

Comment thread src/tensors/braidingtensor.jl Outdated
Comment thread src/tensors/braidingtensor.jl Outdated
Comment thread src/tensors/braidingtensor.jl Outdated
Comment thread src/tensors/braidingtensor.jl Outdated
@kshyatt
Copy link
Copy Markdown
Member Author

kshyatt commented Apr 20, 2026

OK, a lot of comments resolved (hopefully!)

@kshyatt kshyatt marked this pull request as draft April 20, 2026 12:41
@kshyatt
Copy link
Copy Markdown
Member Author

kshyatt commented Apr 20, 2026

CUDA test fail here seems unrelated, I'm running locally to see if I can repro

@kshyatt
Copy link
Copy Markdown
Member Author

kshyatt commented Apr 20, 2026

Aaaaaand I can't repro locally!

Comment thread ext/TensorKitAdaptExt.jl Outdated
Comment thread ext/TensorKitCUDAExt/TensorKitCUDAExt.jl Outdated
Comment thread src/tensors/braidingtensor.jl
Comment thread src/tensors/braidingtensor.jl Outdated
@kshyatt
Copy link
Copy Markdown
Member Author

kshyatt commented Apr 22, 2026

I'm still confused by this factorization test failure, which I cannot locally reproduce and only occurs for FermionParity ⊠ Irrep[SU₂] ⊠ Irrep[U₁]. But it seems it must be related to this PR, as it doesn't occur on main. I'll try to make some progress on this today.

Update: this was also failing here, so maybe it's unrelated

@kshyatt
Copy link
Copy Markdown
Member Author

kshyatt commented Apr 22, 2026

In the meantime, I removed the braiding check commit and squashed a bunch of intermediate stuff that was messing around with CUDA. Let's see how GPU CI does now...

Comment thread src/planar/preprocessors.jl
Comment thread src/planar/preprocessors.jl
Comment thread src/planar/preprocessors.jl
Comment thread src/planar/preprocessors.jl
Comment thread src/tensors/braidingtensor.jl Outdated
Comment thread src/tensors/braidingtensor.jl
Comment thread test/setup.jl
Comment thread test/setup.jl
@Jutho
Copy link
Copy Markdown
Member

Jutho commented Apr 22, 2026

Ok, this looks good to me. I haven't read through the test file in detail; I hope to get to a more massive test review and update at some later stage.

@kshyatt
Copy link
Copy Markdown
Member Author

kshyatt commented Apr 22, 2026

Thanks! I agree we should take another swing at all these tests

@kshyatt kshyatt marked this pull request as ready for review April 22, 2026 13:58
@kshyatt
Copy link
Copy Markdown
Member Author

kshyatt commented Apr 22, 2026

I really cannot figure out this factorization test, which I can repro failing locally on main and appears on various other branches. Unsure what the cause is or if it's related to this at all.

@kshyatt
Copy link
Copy Markdown
Member Author

kshyatt commented Apr 22, 2026

Now it passes!!! I seriously wonder if the --fast is causing this

@lkdvos
Copy link
Copy Markdown
Member

lkdvos commented Apr 22, 2026

In guessing the interaction with the RNG changes in the --fast specification . In any case, id like to have a look at this for a final round of review but might have to be later today since I still have some other things to get to

@kshyatt
Copy link
Copy Markdown
Member Author

kshyatt commented Apr 22, 2026

Sure, makes sense to me. I'm just completely wowed by this bug if it's real, it's so silly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants